/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package vn.edu.hcmus.fit.se.mdd.mbuid.cfcui.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import vn.edu.hcmus.fit.se.mdd.mbuid.cfcui.*;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class CfcuiFactoryImpl extends EFactoryImpl implements CfcuiFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static CfcuiFactory init() {
		try {
			CfcuiFactory theCfcuiFactory = (CfcuiFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.fit.hcmus.edu.vn/se/mdd/mbuid/cfcui"); 
			if (theCfcuiFactory != null) {
				return theCfcuiFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new CfcuiFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CfcuiFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case CfcuiPackage.FORM: return createForm();
			case CfcuiPackage.USER_CONTROL: return createUserControl();
			case CfcuiPackage.PANEL: return createPanel();
			case CfcuiPackage.TAB_PAGE: return createTabPage();
			case CfcuiPackage.TAB_CONTROL: return createTabControl();
			case CfcuiPackage.STATUS_BAR: return createStatusBar();
			case CfcuiPackage.TOOL_BAR: return createToolBar();
			case CfcuiPackage.MAIN_MENU: return createMainMenu();
			case CfcuiPackage.CONTEXT_MENU: return createContextMenu();
			case CfcuiPackage.DATA_SET: return createDataSet();
			case CfcuiPackage.BINDING_SOURCE: return createBindingSource();
			case CfcuiPackage.IMAGE_LIST: return createImageList();
			case CfcuiPackage.BUTTON: return createButton();
			case CfcuiPackage.CHECK_BOX: return createCheckBox();
			case CfcuiPackage.COMBO_BOX: return createComboBox();
			case CfcuiPackage.HSCROLL_BAR: return createHScrollBar();
			case CfcuiPackage.VSCROLL_BAR: return createVScrollBar();
			case CfcuiPackage.SPLITTER: return createSplitter();
			case CfcuiPackage.PROGRESS_BAR: return createProgressBar();
			case CfcuiPackage.TRACK_BAR: return createTrackBar();
			case CfcuiPackage.LINK_LABEL: return createLinkLabel();
			case CfcuiPackage.RADIO_BUTTON: return createRadioButton();
			case CfcuiPackage.DATE_TIME_PICKER: return createDateTimePicker();
			case CfcuiPackage.MONTH_CALENDAR: return createMonthCalendar();
			case CfcuiPackage.DATA_GRID_VIEW: return createDataGridView();
			case CfcuiPackage.LIST_BOX: return createListBox();
			case CfcuiPackage.LIST_VIEW: return createListView();
			case CfcuiPackage.TREE_VIEW: return createTreeView();
			case CfcuiPackage.DOCUMENT_LIST: return createDocumentList();
			case CfcuiPackage.DOMAIN_UP_DOWN: return createDomainUpDown();
			case CfcuiPackage.LABEL: return createLabel();
			case CfcuiPackage.PICTURE_BOX: return createPictureBox();
			case CfcuiPackage.TEXT_BOX: return createTextBox();
			case CfcuiPackage.NUMERIC_UP_DOWN: return createNumericUpDown();
			case CfcuiPackage.MENU_ITEM: return createMenuItem();
			case CfcuiPackage.TOOL_BAR_BUTTON: return createToolBarButton();
			case CfcuiPackage.PRESENTATION_SYSTEM: return createPresentationSystem();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case CfcuiPackage.ANCHOR_TYPE:
				return createAnchorTypeFromString(eDataType, initialValue);
			case CfcuiPackage.DOCK_TYPE:
				return createDockTypeFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case CfcuiPackage.ANCHOR_TYPE:
				return convertAnchorTypeToString(eDataType, instanceValue);
			case CfcuiPackage.DOCK_TYPE:
				return convertDockTypeToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Form createForm() {
		FormImpl form = new FormImpl();
		return form;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public UserControl createUserControl() {
		UserControlImpl userControl = new UserControlImpl();
		return userControl;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Panel createPanel() {
		PanelImpl panel = new PanelImpl();
		return panel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TabPage createTabPage() {
		TabPageImpl tabPage = new TabPageImpl();
		return tabPage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TabControl createTabControl() {
		TabControlImpl tabControl = new TabControlImpl();
		return tabControl;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public StatusBar createStatusBar() {
		StatusBarImpl statusBar = new StatusBarImpl();
		return statusBar;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ToolBar createToolBar() {
		ToolBarImpl toolBar = new ToolBarImpl();
		return toolBar;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MainMenu createMainMenu() {
		MainMenuImpl mainMenu = new MainMenuImpl();
		return mainMenu;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ContextMenu createContextMenu() {
		ContextMenuImpl contextMenu = new ContextMenuImpl();
		return contextMenu;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataSet createDataSet() {
		DataSetImpl dataSet = new DataSetImpl();
		return dataSet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BindingSource createBindingSource() {
		BindingSourceImpl bindingSource = new BindingSourceImpl();
		return bindingSource;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ImageList createImageList() {
		ImageListImpl imageList = new ImageListImpl();
		return imageList;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Button createButton() {
		ButtonImpl button = new ButtonImpl();
		return button;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CheckBox createCheckBox() {
		CheckBoxImpl checkBox = new CheckBoxImpl();
		return checkBox;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ComboBox createComboBox() {
		ComboBoxImpl comboBox = new ComboBoxImpl();
		return comboBox;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public HScrollBar createHScrollBar() {
		HScrollBarImpl hScrollBar = new HScrollBarImpl();
		return hScrollBar;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public VScrollBar createVScrollBar() {
		VScrollBarImpl vScrollBar = new VScrollBarImpl();
		return vScrollBar;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Splitter createSplitter() {
		SplitterImpl splitter = new SplitterImpl();
		return splitter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ProgressBar createProgressBar() {
		ProgressBarImpl progressBar = new ProgressBarImpl();
		return progressBar;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TrackBar createTrackBar() {
		TrackBarImpl trackBar = new TrackBarImpl();
		return trackBar;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LinkLabel createLinkLabel() {
		LinkLabelImpl linkLabel = new LinkLabelImpl();
		return linkLabel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RadioButton createRadioButton() {
		RadioButtonImpl radioButton = new RadioButtonImpl();
		return radioButton;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DateTimePicker createDateTimePicker() {
		DateTimePickerImpl dateTimePicker = new DateTimePickerImpl();
		return dateTimePicker;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MonthCalendar createMonthCalendar() {
		MonthCalendarImpl monthCalendar = new MonthCalendarImpl();
		return monthCalendar;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataGridView createDataGridView() {
		DataGridViewImpl dataGridView = new DataGridViewImpl();
		return dataGridView;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ListBox createListBox() {
		ListBoxImpl listBox = new ListBoxImpl();
		return listBox;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ListView createListView() {
		ListViewImpl listView = new ListViewImpl();
		return listView;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TreeView createTreeView() {
		TreeViewImpl treeView = new TreeViewImpl();
		return treeView;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DocumentList createDocumentList() {
		DocumentListImpl documentList = new DocumentListImpl();
		return documentList;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DomainUpDown createDomainUpDown() {
		DomainUpDownImpl domainUpDown = new DomainUpDownImpl();
		return domainUpDown;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Label createLabel() {
		LabelImpl label = new LabelImpl();
		return label;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PictureBox createPictureBox() {
		PictureBoxImpl pictureBox = new PictureBoxImpl();
		return pictureBox;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TextBox createTextBox() {
		TextBoxImpl textBox = new TextBoxImpl();
		return textBox;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NumericUpDown createNumericUpDown() {
		NumericUpDownImpl numericUpDown = new NumericUpDownImpl();
		return numericUpDown;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MenuItem createMenuItem() {
		MenuItemImpl menuItem = new MenuItemImpl();
		return menuItem;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ToolBarButton createToolBarButton() {
		ToolBarButtonImpl toolBarButton = new ToolBarButtonImpl();
		return toolBarButton;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PresentationSystem createPresentationSystem() {
		PresentationSystemImpl presentationSystem = new PresentationSystemImpl();
		return presentationSystem;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AnchorType createAnchorTypeFromString(EDataType eDataType, String initialValue) {
		AnchorType result = AnchorType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertAnchorTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DockType createDockTypeFromString(EDataType eDataType, String initialValue) {
		DockType result = DockType.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertDockTypeToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CfcuiPackage getCfcuiPackage() {
		return (CfcuiPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static CfcuiPackage getPackage() {
		return CfcuiPackage.eINSTANCE;
	}

} //CfcuiFactoryImpl
